package net.sparrow.mcaccess;

import java.util.List;

import net.minecraft.src.Entity;
import net.minecraft.src.EntityClientPlayerMP;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.GuiScreen;
import net.minecraft.src.Minecraft;
import net.minecraft.src.PlayerControllerMP;
import net.minecraft.src.Session;
import net.minecraft.src.WorldClient;
import net.sparrow.gui.screens.SpScreen;
import net.sparrow.util.Util;

public class MinecraftAccessService {

	
	private Minecraft mc = Minecraft.getMinecraft();
	
	@Deprecated
	public Minecraft minecraft() {
		return mc;
	}
	
	public WorldClient world() {
		return mc.theWorld;
	}
	
	public void displayScreen(GuiScreen screen) {
		mc.displayGuiScreen(screen);
		if (screen instanceof SpScreen) {
			((SpScreen)screen).onScreenOpen();
		}
	}
	
	public EntityClientPlayerMP player() {
		return mc.thePlayer;
	}
	
	public PlayerControllerMP playerCtrl() {
		return mc.playerController;
	}
	
	public Session session() {
		return mc.session;
	}
	
	public List<Entity> loadedEntities() {
		return (List<Entity>)mc.theWorld.loadedEntityList;
	}
	
	public List<EntityPlayer> loadedPlayers() {
		return (List<EntityPlayer>)mc.theWorld.playerEntities;
	}
	
	public int[] colorCodes() {
		return mc.fontRenderer.colorCode;
	}
	
	public GuiScreen currentScreen() {
		return mc.currentScreen;
	}
	
	public int screenWidth() {
		return mc.displayWidth;
	}
	
	public int screenHeight() {
		return mc.displayHeight;
	}
}
